from bs4 import BeautifulSoup
import requests

url = r'https://e-hentai.org/g/2636019/6866d3b60d/'
response = requests.get(url)
response.encoding = 'utf-8'

soup = BeautifulSoup(response.text, 'html.parser')
# print(soup.title.text())

# 获取所有的a标签
for link in soup.find_all('img'):
    img_src = link.get('src')[:4]
    if img_src == "http":
        print(link.get('src'), link.get_text())

    # file_name = ""
    # with open(f"{file_name}.jpg", 'wb') as f:
    #     img = requests.get(url).content
    #     f.write(img)
